import 'package:get/get.dart';
import 'package:getx/common/middleware/router_auth.dart';
import 'package:getx/pages/dependency_put_find/index.dart';
import 'package:getx/pages/dependency_put_find/next_page.dart';
import 'package:getx/pages/get_builder/index.dart';
import 'package:getx/pages/home/index.dart';
import 'package:getx/pages/list/index.dart';
import 'package:getx/pages/list_detail/index.dart';
import 'package:getx/pages/login/index.dart';
import 'package:getx/pages/my/index.dart';
import 'package:getx/pages/notfound/index.dart';
import 'package:getx/pages/state_getx/index.dart';
import 'package:getx/pages/state_obx/index.dart';
import 'package:getx/pages/state_workers/index.dart';
import 'package:getx/pages/value_builder/index.dart';
part 'app_routes.dart';

class AppPages {
  static const INITIAL = AppRoutes.Home;


  static final unknownRoute = GetPage(
    name: AppRoutes.NotFound,
    page: () => const NotfoundView(),
  );

  static final routes = [
    // 白名单
    GetPage(
      name: AppRoutes.Login,
      page: () => const LoginView(),
      transition: Transition.downToUp,
    ),
    GetPage(
      name: AppRoutes.My,
      page: () => const MyView(),
      middlewares: [
        RouteAuthMiddleware(priority: 1),
      ],
    ),
    GetPage(
      name: AppRoutes.StateObx,
      page: () => StateObxView(),
    ),
    GetPage(
      name: AppRoutes.StateGetx,
      page: () => StateGetxView(),
    ),
    GetPage(
      name: AppRoutes.StateGetBuilder,
      page: () => StateGetBuilderView(),
    ),
    GetPage(
      name: AppRoutes.StateValueBuilder,
      page: () => StateValueBuilderView(),
    ),
    GetPage(
      name: AppRoutes.StateWorkers,
      page: () => StateWorkersView(),
    ),
    GetPage(
      name: AppRoutes.StateDependencyPutFind,
      page: () => StateDependencyPutFindView(),
    ),
    GetPage(
      name: AppRoutes.NextPage,
      page: () => NextPageView(),
    ),
    GetPage(
      name: AppRoutes.Home,
      page: () => const HomeView(),
      children: [
        GetPage(
          name: AppRoutes.List,
          page: () => const ListView(),
          children: [
            GetPage(
              name: AppRoutes.Detail,
              page: () => const DetailView(),
            ),
            GetPage(
              name: AppRoutes.Detail_ID,
              page: () => const DetailView(),
            ),
          ],
        ),
      ],
    ),

  ];
}